﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GTA
{
    public partial class FrmPrint : BaseForm
    {
        #region Local Objects
        private String content;
        #endregion

        #region Starting Form
        public FrmPrint()
        {
            InitializeComponent();
        }
        public FrmPrint(String content)
            : this()
        {
            this.content = content;
        }
        private void FrmPrint_Load(object sender, EventArgs e)
        {
            StartForm();
        }
        private void StartForm()
        {
            try
            {
                webBrowser1.DocumentText = content;
            }
            catch (Exception ex)
            {
                HandleException("Inicialização da impressão", ex);
            }
        }
        #endregion

        #region Events
        private void cmdShowPrint_Click(object sender, EventArgs e)
        {
            webBrowser1.ShowPrintPreviewDialog();
        }
        private void cmdPageSetup_Click(object sender, EventArgs e)
        {
            webBrowser1.ShowPageSetupDialog();
        }
        private void cmdPrint_Click(object sender, EventArgs e)
        {
            webBrowser1.Print();
        }
        #endregion
    }
}
